import {createRouter,createWebHashHistory} from 'vue-router'


let router = createRouter({
    history: createWebHashHistory(),
    routes: [
        // 路由配置
        {
          //默认页面
          path:'/',
          redirect:'/main'
        },
        {
          //用户登录页面
          path:'/login',
          component:()=>import('../views/user/LoginView.vue')
        },
        {
          //用户注册页面
          path:'/register',
          component:()=>import('../views/user/RegisterView.vue')
        },
        {
          //用户信息完善页面
          path:'/userInfo',
          component:()=>import('../views/user/UserInfoView.vue')
        },
        {
          //主页面
          //一级路由
          path:'/main',
          component:()=>import('../views/main/MainView.vue'),
          //二级路由
          children:[
            {
              //管理员--增加投资项目
              path:'adminAddInvest',
              component:()=>import('../views/invest/AdminAddInvestView.vue')
            },
            {
              //管理员--管理投资列表
              path:'adminInvestList',
              component:()=>import('../views/invest/AdminInvestListView.vue')
            },
            {
              //管理员--修改投资项目
              path:'adminUpInvest',
              component:()=>import('../views/invest/AdminUpdateView.vue')
            },
            {
              //用户投资项目列表
              path:'userInvestList',
              component:()=>import('../views/invest/UserInvestListView.vue')
            },
            {
              //用户投资项目
              path:'userInvest',
              component:()=>import('../views/invest/UserInvestView.vue')
            },
            {
              //管理员--查看用户投资项目列表
              path:'adminInvestItemList',
              component:()=>import('../views/invest/AdminInvestItemListView.vue')
            },
            {
              //管理员--查看用户投资明细
              path:'adminCheckUserInvest',
              component:()=>import('../views/invest/AdminCheckUserInvestView.vue')
            },
            {
              //用户--投资赎回列表
              path:'userInvestRedeemList',
              component:()=>import('../views/invest/UserInvestRedeemListView.vue')
            },
            {
              //用户--投资赎回
              path:'userRedeem',
              component:()=>import('../views/invest/UserRedeemView.vue')
            },
            {
              //管理员--投资赎回列表
              path:'adminInvestRedeemList',
              component:()=>import('../views/invest/AdminInvestRedeemListView.vue')
            },
            {
              //管理员--查看用户赎回明细
              path:'adminRedeemInfo',
              component:()=>import('../views/invest/AdminUserReceemInfosView.vue')
            },
            {
              //增加理财信息
              path:'adminAddFinace',
              component:()=>import('../views/finance/AdminAddFinaceView.vue')
            },
            {
              //用户理财项目列表
              path:'userFinanceList',
              component:()=>import('../views/finance/UserFinanceList.vue')
            },
            {
              //用户购买理财页面
              path:'userBuyFinance',
              component:()=>import('../views/finance/UserBuyFinance.vue')
            },
            {
              //管理员理财项目列表
              path:'adminFinanceItemList',
              component:()=>import('../views/finance/AdminFinanceItemList.vue')
            },
            {
              //管理员理财赎回列表
              path:'adminFinanceRedeemList',
              component:()=>import('../views/finance/AdminFinanceRedeemList.vue')
            },
            {
              //管理员--用户理财赎回明细
              path:'adminFinanceReceem',
              component:()=>import('../views/finance/AdminFinanceReceem.vue')
            },
            {
              //用户理财明细
              path:'adminbuydetail',
              component:()=>import('../views/finance/AdminCheckUserDetail.vue')
            },
            {
              //用户理财赎回列表
              path:'userFinanceRedeemList',
              component:()=>import('../views/finance/UserFinanceRedeemList.vue')
            },
            {
              //用户赎回页面
              path:'userFinanceRedeem',
              component:()=>import('../views/finance/UserFinanceRedeem.vue')
            },
            {
              //理财信息列表
              path:'adminFinanceList',
              component:()=>import('../views/finance/AdminFinanceListView.vue')
            },
            {
              //修改理财信息
              path:'adminUpdateFinance',
              component:()=>import('../views/finance/UpdateFinanceView.vue')
            },
            {
              //管理员 --增加借款
              path:'adminAddBorrow',
              component:()=>import('../views/borrow/AdminAddBorrowView.vue')
            },
            {
              //管理员 --借款列表
              path:'adminBorrowList',
              component:()=>import('../views/borrow/AdminBorrowListView.vue')
            },
            {
              //使用slot
              path:'borrowTest',
              component:()=>import('../views/borrow/BorrowTestView.vue')
            },
            {
              //管理员 --修改借款信息
              path:'adminUpdateBorrow',
              component:()=>import('../views/borrow/AdminUpdateBorrowView.vue')
            },
            {
              //用户 -- 借款列表
              path:'userBorrwoList',
              component:()=>import('../views/borrow/UserBorrowListView.vue')
            },
            {
              //用户进行借款 --添加借款信息
              path:'userAddBorrowList',
              component:()=>import('../views/borrow/UseraAddBorrwoView.vue')
            },
            {
              //管理员--管理借款信息列表
              path:'adminBorrowItemList',
              component:()=>import('../views/borrow/AdminBorrowItemListView.vue')
            },
            {
              //管理员--查看用户借款明细
              path:'adminCheckBorrowListView',
              component:()=>import('../views/borrow/AdminCheckBorrowListView.vue')
            },
            {
              //用户 --还款列表
              path:'userBorrowRedeemList',
              component:()=>import('../views/borrow/UserBorrowRedeemListView.vue')
            },
            {
              //用户 --借款还款
              path:'userRedeemByUid',
              component:()=>import('../views/borrow/UserRedeemView.vue')
            },
            {
              //管理员--还款列表
              path:'adminBorrowRedeemList',
              component:()=>import('../views/borrow/AdminBorrowRedeemListView.vue')
            },
            {
              //管理员--查看用户还款明细
              path:'adminBorrowByUIDView',
              component:()=>import('../views/borrow/AdminBorrowByUIDView.vue')
            }
          ]
        }
    ]
})

//导出路由
export default router